import request from '../utils/request'

// 获取地址列表
export const getAddressList = () => {
  return request({
    url: '/address/list',
    method: 'get'
  })
}

// 获取默认地址
export const getDefaultAddress = () => {
  return request({
    url: '/address/default',
    method: 'get'
  })
}

// 创建地址
export const createAddress = (address) => {
  return request({
    url: '/address/create',
    method: 'post',
    data: address
  })
}

// 更新地址
export const updateAddress = (address) => {
  return request({
    url: '/address/update',
    method: 'post',
    data: address
  })
}

// 删除地址
export const deleteAddress = (id) => {
  return request({
    url: '/address/delete',
    method: 'post',
    params: { id }
  })
}